Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all integration test in parallel #1912

Conversation

amitkrout
Copy link
Contributor

@amitkrout amitkrout commented Jul 16, 2019

What is the purpose of this change? What does it change?

Runs all command integration test through a single .PHONY statement.

Was the change discussed in an issue?

fixes - part of #1473

How to test changes?

make test-integration-all
make test-integration-all-service-catalog

@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch from 3e1ade5 to d763b3c Compare July 16, 2019 15:02
@amitkrout amitkrout changed the title Run all integration test in parallel [WIP] Run all integration test in parallel Jul 16, 2019
@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. size/L and removed size/S labels Jul 16, 2019
@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch 3 times, most recently from a2be939 to 10f57c6 Compare July 24, 2019 06:26
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Jul 25, 2019
@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch from fbc994e to 29967ab Compare July 26, 2019 13:40
@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. labels Jul 26, 2019
@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch from 51f0fa9 to a434986 Compare July 26, 2019 18:31
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Jul 26, 2019
@amitkrout
Copy link
Contributor Author

amitkrout commented Jul 27, 2019

✗  Unable to connect to OpenShift cluster, is it down

/test integration

@amitkrout
Copy link
Contributor Author

amitkrout commented Jul 27, 2019

[odo]  ✗  Waiting for build to finish [30s]
[odo]  ✗  Failed to create component with name cmp-git. Please use `odo config view` to view settings used to create component. Error: unable to wait for build cmp-git-testing-1 to run: timed out waiting for the condition

/test integration

@amitkrout
Copy link
Contributor Author

[odo]  ✗  Unable to connect to OpenShift cluster, is it down?

/test integration

@amitkrout
Copy link
Contributor Author

[odo]  ✗  Waiting for build to finish [30s]
[odo]  ✗  Failed to create component with name nodejs. Please use `odo config view` to view settings used to create component. Error: unable to wait for build nodejs-myapp-1 to run: timed out waiting for the condition

/test integration

@amitkrout
Copy link
Contributor Author

[odo]  ✗  Waiting for build to finish [30s]
[odo]  ✗  Failed to create component with name cmp-git. Please use `odo config view` to view settings used to create component. Error: unable to wait for build cmp-git-testing-1 to run: timed out waiting for the condition

/test integration

@amitkrout amitkrout changed the title [WIP] Run all integration test in parallel Run all integration test in parallel Jul 28, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Jul 28, 2019
@amitkrout
Copy link
Contributor Author

amitkrout commented Jul 29, 2019

Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Requested few minor changes with the code documentation
  • At multiple places, I see that project variable's definition is being moved by a few lines. Since it's happening many times in the PR, I'm curious to know it's significance.

Makefile Outdated
.PHONY: test-integration
test-integration:
go test -v github.com/openshift/odo/tests/integration -ginkgo.slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -ginkgo.v -timeout $(TIMEOUT)
# Runs all integration test irrespective of service catalog status in the cluster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we say "Runs all integration tests" it includes every test, isn't it? But link and service catalog tests run through test-integration-all-service-catalog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, i understand.

I am open to better name suggestion (Keep in mind that tests depending on service catalog are not part of OpenShift CI).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not suggesting a name change. I'm suggesting to mention that "link" and "service catalog" tests do not run as a part of this test. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, does it make sense ?

Makefile Outdated
-focus="odoCmdApp|odoCmpSubE2e|odoCmpE2e|odo config test|odo storage command|odoWatchE2e|odo generic|odoJavaE2e|odojsonoutput|odo push command tests|odoURLIntegration|odoSourceE2e" \
slowSpecThreshold=$(SLOW_SPEC_THRESHOLD) -randomizeAllSpecs tests/integration/ -timeout 7200s

# Run all integration test which are depend on service catalog enabled cluster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this comment, can we mention the tests that are dependent on service catalog being enabled in cluster? And, if relevant, also mention that in future, tests which require service catalog should be added under this PHONY and not elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this comment, can we mention the tests that are dependent on service catalog being enabled in cluster?

Agree

And, if relevant, also mention that in future, tests which require service catalog should be added under this PHONY and not elsewhere?

This piece of info i am going to add as part of #1831

* For the entire integration test suite:
Entire integration tests suite can be run in parallel and sequentially separately:

* To run entire integration tests spec in parallel (default: 2 ginkgo test node), on a test cluster:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also mention how someone can set the value to something other than 2 if it's relevant for their environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, i can put a note or a place where it fits better in the doc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

----
+

NOTE: `make test-integration` doesn't honour enviornment variable `TEST_EXEC_NODES`. So by default it runs the entire integration test suite on a single ginkgo test node sequentially.
NOTE: `make test-integration-all-service-catalog` can be successfully validated only if the cluster has service catalog enabled. Whereas `make test-integration-all` runs the test irrespective of service catalog status in the cluster.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, IIUC, make test-integration-all doesn't run the tests which explicitly require service catalog to be up. Should we mention that somewhere in this line or elsewhere? Apologies if my understanding is incorrect or it has been mentioned elsewhere already.

Copy link
Contributor Author

@amitkrout amitkrout Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention that somewhere in this line or elsewhere?

I am sorry, could not get you.

Whereas `make test-integration-all` runs the test irrespective of service catalog status in the cluster.

This is the explanation what you are looking for i guess. Right ?

@@ -115,7 +115,7 @@ func NewPreferenceInfo() (*PreferenceInfo, error) {
configFile, err := getPreferenceFile()
glog.V(4).Infof("The configFile is %+v", configFile)
if err != nil {
return nil, errors.Wrap(err, "unable to get odo config file")
return nil, errors.Wrap(err, "unable to get odo preference file")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also change https://github.com/openshift/odo/pull/1912/files#diff-5f21db40ee2e66f00f206912f4dddc2fR116 to write preferenceFile instead of configFile? Using configFile and preferenceFile interchangeably could cause ambiguity, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I am going to update it in the next commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

context = helper.CreateNewContext()
os.Setenv("GLOBALODOCONFIG", filepath.Join(context, "config.yaml"))
project = helper.CreateRandProject()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what impact does this have whether we create a project earlier or later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just to make sure that the set global preference path is used in the project creation step though there is no validation done for it. But if you keep the project create step as it was then project creation step picks the default preference path (~/.odo/preference.yaml) and then the very next odo command start picking the preference path from newly set path.

So i cleaned up this in all test file and later i will create some fresh spec where the validation will be done including all possible cases without duplicating the scenario.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for another discussion, but I think that CreateRandProject should be using oc not odo.

tests/integration/cmd_link_unlink_test.go Show resolved Hide resolved
@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch 4 times, most recently from c4938ce to 65e2e04 Compare July 31, 2019 14:33
@amitkrout amitkrout force-pushed the runAllIntegrationTestInParallel branch from b56eccb to 36fd8f4 Compare August 16, 2019 05:29
@kadel
Copy link
Member

kadel commented Aug 16, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 16, 2019
@openshift-merge-robot openshift-merge-robot merged commit baf308b into redhat-developer:master Aug 16, 2019
@rm3l rm3l added the estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants